<%@ include file="/common/taglibs.jsp"%>
<probiz:pageHeading pageHeadingKey="giftCertificateList.heading" />
<content tag="buttons">
	<probiz:iconBtn btnType="add" 	onclick="return fnDoAdd(this);" />
</content>

<search:searchBox formAction="${ctxPath}/sales/giftCertificate.html">
	<div class="basic_search">
		<search:basicSearch attrPath="s.giftCertificateNo" attrNameKey="giftCertificate.giftCertificateNo" datatype="String"	operator="EQ" classes="inputtxt" labelWidth="68px"/>
	</div>
	<div class="more_search">
		<table border="0" cellspacing="0" cellpadding="0" class="search_table">
			<tr>
				<c:set var="remainedAmtGTE">COL@s.remainedAmt@BigDecimal@GTE</c:set>
				<c:set var="remainedAmtLTE">COL@s.remainedAmt@BigDecimal@LTE</c:set>
				<th width="68px"><label for="${remainedAmtGTE}"><fmt:message key="giftCertificate.remainedAmt"/>:</label></th>
				<td>
					<span><input type="text" id="remainedAmtGTE" name="${remainedAmtGTE}" value="${sc==null?requestScope[remainedAmtGTE]:sc.param[remainedAmtGTE]}" style="width:61px"  class="inputtxt" validConf="price" onblur="validateEventHandler();"/></span>
					<fmt:message key ="giftCertificateList.to"/>
					<span><input type="text" id="remainedAmtLTE" name="${remainedAmtLTE}" value="${sc==null?requestScope[remainedAmtLTE]:sc.param[remainedAmtLTE]}" style="width:61px"  class="inputtxt" validConf="price" onblur="validateEventHandler();"/></span>
				</td>
			</tr>
			<tr>
				<c:set var="giftCertAmtGTE">COL@s.giftCertAmt@BigDecimal@GTE</c:set>
				<c:set var="giftCertAmtLTE">COL@s.giftCertAmt@BigDecimal@LTE</c:set>
				<th><label for="${giftCertAmtGTE}"><fmt:message key="giftCertificate.giftCertAmt"/>:</label></th>
				<td>
					<span><input type="text" id="giftCertAmtGTE" name="${giftCertAmtGTE}" value="${sc==null?requestScope[giftCertAmtGTE]:sc.param[giftCertAmtGTE]}" style="width:61px"  class="inputtxt" validConf="price" onblur="validateEventHandler();"/></span>
					<fmt:message key ="giftCertificateList.to"/>
					<span><input type="text" id="giftCertAmtLTE" name="${giftCertAmtLTE}" value="${sc==null?requestScope[giftCertAmtLTE]:sc.param[giftCertAmtLTE]}" style="width:61px"  class="inputtxt" validConf="price" onblur="validateEventHandler();"/></span>
				</td>
			</tr>
			<search:input attrPath="s.orderNo" attrNameKey="giftCertificate.orderNo" datatype="String" operator="EQ" classes="inputtxt" style="width:150px" labelWidth="48px"/>
			<search:input attrPath="s.orderNoInUse" attrNameKey="giftCertificate.orderNoInUse" datatype="String" operator="EQ" classes="inputtxt" style="width:150px" labelWidth="48px"/>
			<search:input attrPath="s.purchaser" attrNameKey="giftCertificate.purchaser" datatype="String" operator="LIKE" classes="inputtxt" style="width:150px" labelWidth="48px"/>
			<search:input attrPath="s.recipient" attrNameKey="giftCertificate.recipient" datatype="String" operator="LIKE" classes="inputtxt" style="width:150px" labelWidth="48px"/>
			<search:input attrPath="s.recipientEmail" attrNameKey="giftCertificate.recipientEmail" datatype="String" operator="LIKE" classes="inputtxt" style="width:150px" labelWidth="48px"/>
			
			<tr>
				<c:set var="giftCertificateStatus">state</c:set>
				<c:set var="giftCertificateStatusValue">${sc==null?requestScope[giftCertificateStatus]:sc.param[giftCertificateStatus]}</c:set>
				<th><label for="${giftCertificateStatus}"><fmt:message key="giftCertificate.status"/><fmt:message key="common.message.colon"/></label></th>
				<td>
					<select name="${giftCertificateStatus}" id="giftCertificateStatus" class="selecttxt" style="width:150px">
						<option value="" ${(empty giftCertificateStatusValue)?'selected':''}><fmt:message key="giftCertificate.sa_state.sAll"/></option>
						<option value="1" ${(not empty giftCertificateStatusValue and giftCertificateStatusValue == 1)?'selected':''}><fmt:message key="giftCertificate.sa_state.s1"/></option>
						<option value="2" ${(not empty giftCertificateStatusValue and giftCertificateStatusValue == 2)?'selected':''}><fmt:message key="giftCertificate.sa_state.s2"/></option>
						<option value="0" ${(not empty giftCertificateStatusValue and giftCertificateStatusValue == 0)?'selected':''}><fmt:message key="giftCertificate.sa_state.s0"/></option>
						<option value="3" ${(not empty giftCertificateStatusValue and giftCertificateStatusValue == 3)?'selected':''}><fmt:message key="giftCertificate.sa_state.s3"/></option>
					</select>
				</td>
			</tr>
			
		</table>
	</div>
</search:searchBox>


<form class="mainForm" name="mainForm" method="post">

	<c:set var="editURLPath" value="/sales/giftCertificate.html?doAction=edit&from=list" scope="page" />
	<div class="top clearfix">
		<ul class="tab">
			<li class="curr"><span><fmt:message key="menu.giftCertificateList"/></span></li>
		</ul>
		<%@include file="/common/pagingOnlyTop.jsp"%>
	</div>
	<div class="data">
		<c:set var="checkAll">
			<input type="checkbox" name="allbox" onclick="checkAll(this.form)"
				style="margin: 0 0 0 0px" />
		</c:set>
		<display:table name="${giftCertificateList}" cellspacing="0" cellpadding="0" uid="giftCertificateItem" class="list_table"	export="false" requestURI="">
			
			<display:column style="" property="giftCertificateNo" sortable="true"
				headerClass="data-table-title"
				url="/sales/giftCertificate.html?doAction=edit"
				paramId="giftCertificateId" paramProperty="giftCertificateId"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.giftCertificateNo" />
			
			<display:column style="width: 10%;" sortable="true" headerClass="data-table-title"
				titleKey="giftCertificate.remainedAmt">
				<common:currencyFormat value="${giftCertificateItem.remainedAmt}"/>
			</display:column>
			<display:column style="width: 10%;" sortable="true" headerClass="data-table-title"
				titleKey="giftCertificate.giftCertAmt">
				<common:currencyFormat value="${giftCertificateItem.giftCertAmt}"/>
			</display:column>
			<display:column style="width: 12%;" property="orderNo" sortable="true"
				headerClass="data-table-title"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.orderNo" />
			<display:column style="width: 12%;" property="orderNoInUse" sortable="true"
				headerClass="data-table-title"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.orderNoInUse" />
			<display:column style="width: 12%;" sortable="true"
				headerClass="data-table-title"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.createTime" >
					<common:datetimeFormat date="${giftCertificateItem.createTime}" />
			</display:column>
			<display:column style="width: 12%;" sortable="true"
				headerClass="data-table-title"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.expireTime" >
					<common:datetimeFormat date="${giftCertificateItem.expireTime}" />
			</display:column>
			<display:column style="width: 5%;" sortable="false" headerClass="data-table-title"
				decorator="com.probiz.estore.core.decorator.TblColumnDecorator"
				titleKey="giftCertificate.status">
					<span class="${stateClass}"><fmt:message key="giftCertificate.sa_state.s${giftCertificateItem.state}" /></span>
			</display:column>
		
		</display:table>
		<%@include file="/common/paging.jsp"%>
	</div>
</form>
<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("giftCertificateItem");
});
</script>

